﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebSite.Web.Models;

namespace WebSite.Web.SessionAndFilter
{
    public static class Sessions
    {
        /// <summary>
        /// 登录用户
        /// </summary>
        public static AdminUserVM User
        {
            get
            {
                HttpContext.Current.Session.Timeout = 60;
                return HttpContext.Current.Session["User"] as AdminUserVM;
            }

            set
            {
                HttpContext.Current.Session.Timeout = 60;
                HttpContext.Current.Session["User"] = value;
            }
        }
        /// <summary>
        /// 验证码
        /// </summary>
        public static string ValidateCode
        {
            get
            {
                HttpContext.Current.Session.Timeout = 60;
                return HttpContext.Current.Session["ValidateCode"] as string;
            }

            set
            {
                HttpContext.Current.Session.Timeout = 60;
                HttpContext.Current.Session["ValidateCode"] = value;
            }
        }

    }
}